/*
 * 泛型
 */
class Point<T> {
    private T x;
    private T y;

    public void setX(T t) {
        this.x = t;
    }

    public T getX() {
        return x;
    }

    public void setY(T t) {
        this.y = t;
    }

    public T getY() {
        return y;
    }
}

public class GenericDemo1 {
    public static void main(String[] args) {
        Point<Float> p = new Point<Float>();
        p.setX(10f);
        p.setY(100f);
        System.out.println(p.getX());
        System.out.println(p.getY());
        System.out.println("--------");
        Point<String> ps = new Point<String>();
        ps.setX("经度100");
        ps.setY("纬度100");
        System.out.println(ps.getX());
        System.out.println(ps.getY());
    }
}
